<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    // 把两个对象进行合并
    let c = Object.assign({ a: 1 }, { b: 2 });
    console.log(c);

    function upload(options) {
      let necc = {
        host: "10.1.1.1",
      };
      options = Object.assign(options, necc);
      console.log(JSON.stringify(options, null, 2));
    }

    upload({ size: 99, type: "txt" });
  </script>
</html>
